package com.kafka.example.kafka.controller;

import com.kafka.example.kafka.service.KafkaSender;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author CodeDancing
 * @version 1.0
 * @date 2022/2/17 3:41 下午
 */

@RestController
@RequestMapping("test/kafka")
public class KafkaController {

	@Autowired
	private KafkaSender kafkaSender;
		 
	/**
	 * http://127.0.0.1:8080/test/kafka/send
	 * @return string
	 */
	@RequestMapping("send")
	public String send() {
		String result = "成功";
		kafkaSender.sendMessage();
		return result;
	}
}
